#ifndef __UI_TOUCH_H
#define	__UI_TOUCH_H

#include <stdint.h>
#include "dataproc.h"
#include "mytype.h"

#ifdef	__cplusplus
extern "C" {
#endif
	
struct ui_touch_obj_str
{
    struct 
    {
        ii16 x,y;
    } site;
    struct 
    {
        ii16 x,y;
    } size;
    uu32 user_data;
    void (*press_callback)(struct ui_touch_obj_str * info);
	void (*press_edge_callback)(struct ui_touch_obj_str * info);
	void (*release_callback)(struct ui_touch_obj_str * info);
    struct ui_touch_obj_str * next;
};

typedef struct ui_touch_obj_str ui_touch_obj_type;

struct ui_text_in_obj_str
{
    ii16 index_next;
    ii16 len; 
    ii16 len_remain; 
    uu8 b_rang_en; 
    uu8 in_pn; 
    ii32 num; 
    ii32 min; 
    ii32 max; 
    char * buff;
};
typedef struct ui_text_in_obj_str ui_text_in_obj_type;

char ui_touch_point_check(ui_touch_obj_type *list, uu16 list_len, ii16 x, ii16 y);

void ui_touch_rang_set(ii16 x, ii16 y, ii16 wide, ii16 high);

void ui_text_input_reset(ui_text_in_obj_type *obj, uu8 *buff, ii16 len);
uu8 ui_text_input_add(ui_text_in_obj_type *obj,  uu8 ch);
void ui_text_input_del(ui_text_in_obj_type *obj);

void ui_num_text_input_rang(ui_text_in_obj_type *obj, uu8 en, ii32 min, ii32 max);
void ui_num_text_input_inpn_set(ui_text_in_obj_type *obj, uu8 in, uu8 pn);
uu8 ui_num_text_input_add(ui_text_in_obj_type *obj,  uu8 ch);
void ui_num_text_input_del(ui_text_in_obj_type *obj);

#ifdef	__cplusplus
}
#endif

#endif	
